package org.shopen.puremvc.controller.testing
{
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	import org.shopen.puremvc.ApplicationConstants;
	import org.shopen.puremvc.model.ManifestProxy;
	import org.shopen.puremvc.model.TestingProxy;

	public class InitTestingsCommand extends SimpleCommand
	{
		override public function execute(notification:INotification):void
		{
			try
			{
				var manifestProxy : ManifestProxy = facade.retrieveProxy(ManifestProxy.NAME) as ManifestProxy;
				var testingsXML : XML = manifestProxy.testingsXML;
				var testingProxy : TestingProxy = facade.retrieveProxy(TestingProxy.NAME) as TestingProxy;
				testingProxy.initData(testingsXML);
			}
			catch (error : Error)
			{
				sendNotification(ApplicationConstants.GENERAL_ERROR, error);
			}
		}
	}
}